Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support


ProDOS 8
#17:    Recursive ProDOS Catalog Routine

Revised by:    Keith Rollin & Matt Deatherage                   November 1988
Written by:    Greg Seitz                                       December 1983

This Technical Note presents an assembly language example of a recursive 
directory reading routine which is AppleShare compatible.
_____________________________________________________________________________

This Note presents a routine in assembly language for recursively cataloging a 
ProDOS disk, and if you apply this technique to the volume directory of a 
disk, it will display the name of every file stored on the disk.  The routine 
displays the contents of a given directory, the volume directory in this case, 
then displays the contents of every directory contained within the initial 
directory.

Previous versions of the Note recommended reading the directory with 
READ_BLOCK ProDOS calls.  This method will still work in most cases, but Apple 
Computer no longer endorses it since block-level access is not allowed to 
AppleShare file servers under ProDOS.  (A file server cannot handle one 
machine connected to it changing files and directories on a block level while 
it is trying to arbitrate usage between other machines at the file level.  A 
block-level change behind the server's back could easily mess things up 
catastrophically.)

If you are willing to use a different approach, however, you can read the 
directory just as easily using READ calls.  Instead of using directory 
pointers to decide which block to read next, we simply read the directory and 
display filenames as we go, until we reach a subdirectory file.  When we reach 
a subdirectory, the routine saves the necessary variables, plunges down one 
level of the tree structure, and catalogs the subdirectory.  You repeat the 
process if you find a subdirectory at the current level.  When you reach the 
EOF of any directory, the routine closes the current directory and pops back 
up one level, and when it reaches the EOF of the initial directory, the 
routine is finished.

The code example on the following pages includes a simple test of the ReadDir 
routine, which is the actual recursive catalog routine.  Note that the simple 
test relies upon the GETBUFR routine in BASIC.SYSTEM to allocate a buffer; 
therefore, as presented, the routine requires the presence of BASIC.SYSTEM.  
The actual ReadDir routine requires nothing outside of the ProDOS 8 MLI.



01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 2
 
----- NEXT OBJECT FILE NAME IS CATALOG.OBJ                   
0800:        0800    2           org   $800
0800:                3 *******************************************************
0800:                4 *
0800:                5 * Recursive ProDOS Catalog Routine
0800:                6 *
0800:                7 * by: Greg Seitz 12/83
0800:                8 *     Pete McDonald 1/86
0800:                9 *     Keith Rollin 7/88
0800:               10 *
0800:               11 * This program shows the latest "Apple Approved"
0800:               12 * method for reading a ProDOS directory. With
0800:               13 * the advent of AppleTalk for the Apple II, using
0800:               14 * _READBLOCK to read the directory will no longer
0800:               15 * work. This routine has been re-written to read
0800:               16 * directories by opening them as files, and
0800:               17 * performing simple _READ commands.
0800:               18 *
0800:               19 *******************************************************
0800:               20 *
0800:               21 * Equates
0800:               22 *
0800:               23 * Zero page locations
0800:               24 *
0800:        0080   25 dirName   equ   $80           ; pointer to directory name
0800:        0082   26 entPtr    equ   $82           ; ptr to current entry
0800:               27 *
0800:               28 *
0800:               29 * ProDOS command numbers
0800:               30 *
0800:        BF00   31 MLI       equ   $BF00         ; MLI entry point
0800:        BEF5   32 GetBufr   equ   $BEF5         ; BASIC.SYSTEM get buffer routine
0800:               33 *
0800:        00C7   34 GetPCmd   equ   $C7           ; Get Prefix
0800:        00C8   35 OpenCmd   equ   $C8           ; Open a file command
0800:        00CA   36 ReadCmd   equ   $CA           ; Read a file command
0800:        00CC   37 CloseCmd  equ   $CC           ; Close a file command
0800:        00CE   38 SetMCmd   equ   $CE           ; Set File Position command
0800:               39 *
0800:               40 *
0800:               41 * Offsets into the directory
0800:               42 *
0800:        0000   43 oType     equ   $0            ; offset to file type byte
0800:        0023   44 oEntLen   equ   $23           ; length of each dir. entry
0800:        0024   45 oEntBlk   equ   $24           ; entries in each block
0800:        0025   46 oEntDir   equ   $25           ; entries in entire directory
0800:               47 *
0800:               48 *
0800:               49 * Monitor routines
0800:               50 *
0800:        FDED   51 cout      equ   $FDED         ; output a character
0800:        FD8E   52 crout     equ   $FD8E         ; output a RETURN
0800:               53 *
0800:               54 *******************************************************
0800:               55 *
0800:        0800   56 Start     equ   *
0800:               57 *
0800:               58 * Simple routine to test the recursive ReadDir

01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 3
 
0800:               59 * routine. It gets an I/O buffer for ReadDir, gets
0800:               60 * the current prefix, sets the depth of recursion
0800:               61 * to zero, and calls ReadDir to process all of the
0800:               62 * entries in the directory.
0800:               63 *
0800:A9 04          64           lda   #4            ; get an I/O buffer
0802:20 F5 BE       65           jsr   GetBufr
0805:B0 17   081E   66           bcs   exit          ; didn't get it
0807:8D DD 09       67           sta   ioBuf+1
080A:               68 *
080A:20 00 BF       69           jsr   MLI
080D:C7             70           db    GetPCmd
080E:EE 09          71           dw    GetPParms
0810:B0 0C   081E   72           bcs   exit
0812:               73 *
0812:A9 00          74           lda   #0
0814:8D D2 09       75           sta   Depth
0817:               76 *
0817:A9 F1          77           lda   #nameBuffer
0819:A2 0B          78           ldx   #<nameBuffer
081B:20 1F 08       79           jsr   ReadDir
081E:               80 *
081E:        081E   81 exit      equ   *
081E:60             82           rts
081F:               83 *
081F:               84 *******************************************************
081F:               85 *
081F:        081F   86 ReadDir   equ   *
081F:               87 *
081F:               88 *  This is the actual recursive routine. It takes as
081F:               89 *  input a pointer to the directory name to read in
081F:               90 *  A,X (lo,hi), opens it, and starts to read the
081F:               91 *  entries. When it encounters a filename, it calls
081F:               92 *  the routine "VisitFile". When it encounters a
081F:               93 *  directory name, it calls "VisitDir".
081F:               94 *
081F:               95 *******************************************************
081F:               96 *
081F:85 80          97           sta   dirName       ; save a pointer to name
0821:86 81          98           stx   dirName+1
0823:               99 *
0823:8D DA 09      100           sta   openName      ; set up OpenFile params
0826:8E DB 09      101           stx   openName+1
0829:              102 *
0829:        0829  103 ReadDir1  equ   *             ; recursive entry point
0829:20 54 08      104           jsr   OpenDir       ; open the directory as a file
082C:B0 1F   084D  105           bcs   done
082E:              106 *
082E:4C 48 08      107           jmp   nextEntry     ; jump to the end of the loop
0831:              108 *
0831:        0831  109 loop      equ   *
0831:A0 00         110           ldy   #oType        ; get type of current entry
0833:B1 82         111           lda   (entPtr),y
0835:C9 00         112           cmp   #0            ; inactive entry?
0837:F0 0F   0848  113           beq   nextEntry     ; yes - bump to next one
0839:29 F0         114           and   #$F0          ; look at 4 high bits
083B:C9 D0         115           cmp   #$D0          ; is it a directory?
083D:F0 06   0845  116           beq   ItsADir       ; yes, so call VisitDir

01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 4
 
083F:20 9A 08      117           jsr   VisitFile     ; no, it's a file
0842:4C 48 08      118           jmp   nextEntry
0845:        0845  119 ItsADir   equ   *
0845:20 A1 08      120           jsr   VisitDir
0848:        0848  121 nextEntry equ   *
0848:20 68 09      122           jsr   GetNext       ; get pointer to next entry
084B:90 E4   0831  123           bcc   loop          ; Carry set means we're done
084D:        084D  124 done      equ   *
084D:              125 *
084D:20 00 BF      126           jsr   MLI           ; close the directory
0850:CC            127           db    CloseCmd
0851:E7 09         128           dw    CloseParms
0853:              129 *
0853:60            130           rts
0854:              131 *
0854:              132 *******************************************************
0854:              133 *
0854:        0854  134 OpenDir   equ   *
0854:              135 *
0854:              136 *  Opens the directory pointed to by OpenParms
0854:              137 *  parameter block. This pointer should be init-
0854:              138 *  ialized BEFORE this routine is called. If the
0854:              139 *  file is successfully opened, the following
0854:              140 *  variables are set:
0854:              141 *
0854:              142 *     xRefNum     ; all the refnums
0854:              143 *     entryLen    ; size of directory entries
0854:              144 *     entPtr      ; pointer to current entry
0854:              145 *     ThisBEntry  ; entry number within this block
0854:              146 *     ThisEntry   ; entry number within this dir.
0854:              147 *     ThisBlock   ; offset (in blocks) into dir.
0854:              148 *
0854:20 00 BF      149           jsr   MLI           ; open dir as a file
0857:C8            150           db    OpenCmd
0858:D9 09         151           dw    OpenParms
085A:B0 3D   0899  152           bcs   OpenDone
085C:              153 *
085C:AD DE 09      154           lda   oRefNum       ; copy the refnum return-
085F:8D E0 09      155           sta   rRefNum       ; ed by Open into the
0862:8D E8 09      156           sta   cRefNum       ; other param blocks.
0865:8D EA 09      157           sta   sRefNum
0868:              158 *
0868:20 00 BF      159           jsr   MLI           ; read the first block
086B:CA            160           db    ReadCmd
086C:DF 09         161           dw    ReadParms
086E:B0 29   0899  162           bcs   OpenDone
0870:              163 *
0870:AD 14 0A      164           lda   buffer+oEntLen ; init 'entryLen'
0873:8D D7 09      165           sta   entryLen
0876:              166 *
0876:A9 F5         167           lda   #buffer+4     ; init ptr to first entry
0878:85 82         168           sta   entPtr
087A:A9 09         169           lda   #<buffer+4
087C:85 83         170           sta   entPtr+1
087E:              171 *
087E:AD 15 0A      172           lda   buffer+oEntblk ; init these values based on
0881:8D D5 09      173           sta   ThisBEntry    ; values in the dir header
0884:8D D8 09      174           sta   entPerBlk

01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 5
 
0887:AD 16 0A      175           lda   buffer+oEntDir
088A:8D D3 09      176           sta   ThisEntry
088D:AD 17 0A      177           lda   buffer+oEntDir+1
0890:8D D4 09      178           sta   ThisEntry+1
0893:              179 *
0893:A9 00         180           lda   #0            ; init block offset into dir.
0895:8D D6 09      181           sta   ThisBlock
0898:              182 *
0898:18            183           clc                 ; say that open was OK
0899:              184 *
0899:        0899  185 OpenDone  equ   *
0899:60            186           rts
089A:              187 *
089A:              188 *******************************************************
089A:              189 *
089A:        089A  190 VisitFile equ   *
089A:              191 *
089A:              192 * Do whatever is necessary when we encounter a
089A:              193 * file entry in the directory. In this case, we
089A:              194 * print the name of the file.
089A:              195 *
089A:20 A7 09      196           jsr   PrintEntry
089D:20 8E FD      197           jsr   crout
08A0:60            198           rts
08A1:              199 *
08A1:              200 *******************************************************
08A1:              201 *
08A1:        08A1  202 VisitDir  equ   *
08A1:              203 *
08A1:              204 * Print the name of the subdirectory we are looking
08A1:              205 * at, appending a "/" to it (to indicate that it's
08A1:              206 * a directory), and then calling RecursDir to list
08A1:              207 * everything in that directory.
08A1:              208 *
08A1:20 A7 09      209           jsr   PrintEntry    ; print dir's name
08A4:A9 AF         210           lda   #'/'|$80      ; tack on / at end
08A6:20 ED FD      211           jsr   cout
08A9:20 8E FD      212           jsr   crout
08AC:              213 *
08AC:20 B0 08      214           jsr   RecursDir     ; enumerate all entries in sub-dir.
08AF:              215 *
08AF:60            216           rts
08B0:              217 *
08B0:              218 *******************************************************
08B0:              219 *
08B0:        08B0  220 RecursDir equ   *
08B0:              221 *
08B0:              222 * This routine calls ReadDir recursively. It
08B0:              223 *
08B0:              224 * - increments the recursion depth counter,
08B0:              225 * - saves certain variables onto the stack
08B0:              226 * - closes the current directory
08B0:              227 * - creates the name of the new directory
08B0:              228 * - calls ReadDir (recursively)
08B0:              229 * - restores the variables from the stack
08B0:              230 * - restores directory name to original value
08B0:              231 * - re-opens the old directory
08B0:              232 * - moves to our last position within it

01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 6
 
08B0:              233 * - decrements the recursion depth counter
08B0:              234 *
08B0:EE D2 09      235           inc   Depth         ; bump this for recursive call
08B3:              236 *
08B3:              237 * Save everything we can think of (the women,
08B3:              238 * the children, the beer, etc.).
08B3:              239 *
08B3:A5 82         240           lda   entPtr
08B5:48            241           pha
08B6:A5 83         242           lda   entPtr+1
08B8:48            243           pha
08B9:AD D3 09      244           lda   ThisEntry
08BC:48            245           pha
08BD:AD D4 09      246           lda   ThisEntry+1
08C0:48            247           pha
08C1:AD D5 09      248           lda   ThisBEntry
08C4:48            249           pha
08C5:AD D6 09      250           lda   ThisBlock
08C8:48            251           pha
08C9:AD D7 09      252           lda   entryLen
08CC:48            253           pha
08CD:AD D8 09      254           lda   entPerblk
08D0:48            255           pha
08D1:              256 *
08D1:              257 * Close the current directory, as ReadDir will
08D1:              258 * open files of its own, and we don't want to 
08D1:              259 * have a bunch of open files lying around.
08D1:              260 *
08D1:20 00 BF      261           jsr   MLI
08D4:CC            262           db    CloseCmd
08D5:E7 09         263           dw    CloseParms
08D7:              264 *
08D7:20 20 09      265           jsr   ExtendName    ; make new dir name
08DA:              266 *
08DA:20 29 08      267           jsr   ReadDir1      ; enumerate the subdirectory
08DD:              268 *
08DD:20 56 09      269           jsr   ChopName      ; restore old directory name
08E0:              270 *
08E0:20 54 08      271           jsr   OpenDir       ; re-open it back up
08E3:              272 *
08E3:              273 * Restore everything that we saved before
08E3:              274 *
08E3:68            275           pla
08E4:8D D8 09      276           sta   entPerBlk
08E7:68            277           pla
08E8:8D D7 09      278           sta   entryLen
08EB:68            279           pla
08EC:8D D6 09      280           sta   Thisblock
08EF:68            281           pla
08F0:8D D5 09      282           sta   ThisBEntry
08F3:68            283           pla
08F4:8D D4 09      284           sta   ThisEntry+1
08F7:68            285           pla
08F8:8D D3 09      286           sta   ThisEntry
08FB:68            287           pla
08FC:85 83         288           sta   entPtr+1
08FE:68            289           pla
08FF:85 82         290           sta   entPtr

01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 7
 
0901:              291 *
0901:AD D6 09      292           lda   ThisBlock     ; reset last position in dir
0904:0A            293           asl   a             ; = to block # times 512
0905:8D EC 09      294           sta   Mark+1
0908:A9 00         295           lda   #0
090A:8D EB 09      296           sta   Mark
090D:8D ED 09      297           sta   Mark+2
0910:              298 *
0910:20 00 BF      299           jsr   MLI           ; reset the file marker
0913:CE            300           db    SetMCmd
0914:E9 09         301           dw    SetMParms
0916:              302 *
0916:20 00 BF      303           jsr   MLI           ; now read in the block we
0919:CA            304           db    ReadCmd       ; were on last.
091A:DF 09         305           dw    ReadParms
091C:              306 *
091C:CE D2 09      307           dec   Depth
091F:60            308           rts
0920:              309 *
0920:              310 *******************************************************
0920:              311 *
0920:        0920  312 ExtendName equ  *
0920:              313 *
0920:              314 * Append the name in the current directory entry
0920:              315 * to the name in the directory name buffer. This
0920:              316 * will allow us to descend another level into the
0920:              317 * disk hierarchy when we call ReadDir.
0920:              318 *
0920:A0 00         319           ldy   #0            ; get length of string to copy
0922:B1 82         320           lda   (entPtr),y    
0924:29 0F         321           and   #$0F
0926:8D 53 09      322           sta   extCnt        ; save the length here
0929:8C 54 09      323           sty   srcPtr        ; init src ptr to zero
092C:              324 *
092C:A0 00         325           ldy   #0            ; init dest ptr to end of
092E:B1 80         326           lda   (dirName),y   ; the current directory name
0930:8D 55 09      327           sta   destPtr
0933:              328 *
0933:        0933  329 extloop   equ   *
0933:EE 54 09      330           inc   srcPtr        ; bump to next char to read
0936:EE 55 09      331           inc   destPtr       ; bump to next empty location
0939:AC 54 09      332           ldy   srcPtr        ; get char of sub-dir name
093C:B1 82         333           lda   (entPtr),y
093E:AC 55 09      334           ldy   destPtr       ; tack on to end of cur. dir.
0941:91 80         335           sta   (dirName),y
0943:CE 53 09      336           dec   extCnt        ; done all chars?
0946:D0 EB   0933  337           bne   extloop       ; no - so do more
0948:              338 *
0948:C8            339           iny
0949:A9 2F         340           lda   #'/'          ; tack "/" on to the end
094B:91 80         341           sta   (dirName),y
094D:              342 *
094D:98            343           tya                 ; fix length of filename to open
094E:A0 00         344           ldy   #0
0950:91 80         345           sta   (dirName),y
0952:              346 *
0952:60            347           rts
0953:              348 *

01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 8
 
0953:        0001  349 extCnt    ds    1
0954:        0001  350 srcPtr    ds    1
0955:        0001  351 destPtr   ds    1
0956:              352 *
0956:              353 *
0956:              354 *******************************************************
0956:              355 *
0956:        0956  356 ChopName  equ   *
0956:              357 *
0956:              358 * Scans the current directory name, and chops
0956:              359 * off characters until it gets to a /.
0956:              360 *
0956:A0 00         361           ldy   #0            ; get len of current dir.
0958:B1 80         362           lda   (dirName),y
095A:A8            363           tay
095B:        095B  364 ChopLoop  equ   *
095B:88            365           dey                 ; bump to previous char
095C:B1 80         366           lda   (dirName),y
095E:C9 2F         367           cmp   #'/'
0960:D0 F9   095B  368           bne   ChopLoop
0962:98            369           tya
0963:A0 00         370           ldy   #0
0965:91 80         371           sta   (dirName),y
0967:60            372           rts
0968:              373 *
0968:              374 *******************************************************
0968:              375 *
0968:        0968  376 GetNext   equ   *
0968:              377 *
0968:              378 * This routine is responsible for making a pointer
0968:              379 * to the next entry in the directory. If there are
0968:              380 * still entries to be processed in this block, then
0968:              381 * we simply bump the pointer by the size of the
0968:              382 * directory entry. If we have finished with this
0968:              383 * block, then we read in the next block, point to
0968:              384 * the first entry, and increment our block counter.
0968:              385 *
0968:AD D3 09      386           lda   ThisEntry     ; dec total entries
096B:D0 05   0972  387           bne   skip1
096D:CE D4 09      388           dec   ThisEntry+1
0970:30 33   09A5  389           bmi   DirDone       ; done with this directory
0972:CE D3 09      390 skip1     dec   ThisEntry
0975:              391 *
0975:CE D5 09      392           dec   ThisBEntry    ; dec count for this block
0978:F0 10   098A  393           beq   ReadNext      ; done w/this block, get next one
097A:              394 *
097A:18            395           clc                 ; else bump up index
097B:A5 82         396           lda   entPtr
097D:6D D7 09      397           adc   entryLen
0980:85 82         398           sta   entPtr
0982:A5 83         399           lda   entPtr+1
0984:69 00         400           adc   #0
0986:85 83         401           sta   entPtr+1
0988:18            402           clc                 ; say that the buffer's good
0989:60            403           rts
098A:              404 *
098A:        098A  405 ReadNext  equ   *
098A:20 00 BF      406           jsr   MLI           ; get the next block

01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 9
 
098D:CA            407           db    ReadCmd
098E:DF 09         408           dw    ReadParms
0990:B0 13   09A5  409           bcs   DirDone
0992:              410 *
0992:A9 F5         411           lda   #buffer+4     ; set entry pointer to beginning
0994:85 82         412           sta   entPtr
0996:A9 09         413           lda   #<buffer+4
0998:85 83         414           sta   entPtr+1
099A:              415 *
099A:AD D8 09      416           lda   entPerBlk     ; re-init 'entries in this block'
099D:8D D5 09      417           sta   ThisBEntry
09A0:CE D5 09      418           dec   ThisBEntry
09A3:18            419           clc                 ; return 'No error'
09A4:60            420           rts
09A5:              421 *
09A5:        09A5  422 DirDone   equ   *             ; return 'All Done!'
09A5:38            423           sec                 ; return 'an error occurred'
09A6:60            424           rts
09A7:              425 *
09A7:              426 *******************************************************
09A7:              427 *
09A7:        09A7  428 PrintEntry equ  *
09A7:              429 *
09A7:              430 * Using the pointer to the current entry, this 
09A7:              431 * routine prints the entry name. It also pays
09A7:              432 * attention to the recursion depth, and indents
09A7:              433 * by 1 space for every level.
09A7:              434 *
09A7:AD D2 09      435           lda   Depth         ; init counter for indenting
09AA:8D D1 09      436           sta   PrntCnt
09AD:4C B5 09      437           jmp   spcDec
09B0:A9 A0         438 spcloop   lda   #$A0          ; print a space for indenting
09B2:20 ED FD      439           jsr   cout
09B5:        09B5  440 spcDec    equ   *
09B5:CE D1 09      441           dec   PrntCnt       ; any more indenting?
09B8:10 F6   09B0  442           bpl   spcloop       ; yes - keep going
09BA:              443 *
09BA:A0 00         444           ldy   #0            ; get byte that has the length byte
09BC:B1 82         445           lda   (entPtr),y
09BE:29 0F         446           and   #$0F          ; get just the length
09C0:8D D1 09      447           sta   PrntCnt       ; put it into our counter
09C3:        09C3  448 PrntLoop  equ   *
09C3:C8            449           iny                 ; bump to the next char.
09C4:B1 82         450           lda   (entPtr),y    ; get next char
09C6:09 80         451           ora   #$80          ; COUT likes high bit set
09C8:20 ED FD      452           jsr   cout          ; print it
09CB:CE D1 09      453           dec   PrntCnt       ; printed all chars?
09CE:D0 F3   09C3  454           bne   PrntLoop      ; no - keep going
09D0:60            455           rts
09D1:              456 *
09D1:        0001  457 PrntCnt   ds    1             ; counter for printing
09D2:              458 *
09D2:              459 *******************************************************
09D2:              460 *
09D2:              461 * Some global variables
09D2:              462 *
09D2:        0001  463 Depth     ds    1             ; amount of recursion
09D3:        0002  464 ThisEntry ds    2             ; abs entry number

01 RECURSIVE.S     ProDOS Catalog Routine              27-AUG-88  16:20 PAGE 10
 
09D5:        0001  465 ThisBEntry ds   1             ; entry in this block
09D6:        0001  466 ThisBlock ds    1             ; block with dir
09D7:        0001  467 entryLen  ds    1             ; length of each directory entry
09D8:        0001  468 entPerBlk ds    1             ; entries per block
09D9:              469 *
09D9:              470 *******************************************************
09D9:              471 *
09D9:              472 * ProDOS command parameter blocks
09D9:              473 *
09D9:        09D9  474 OpenParms equ   *
09D9:03            475           db    3             ; number of parms
09DA:        0002  476 OpenName  ds    2             ; pointer to filename
09DC:00 00         477 ioBuf     dw    $0000         ; I/O buffer
09DE:        0001  478 oRefNum   ds    1             ; returned refnum
09DF:              479 *
09DF:        09DF  480 ReadParms equ   *
09DF:04            481           db    4             ; number of parms
09E0:        0001  482 rRefNum   ds    1             ; refnum from Open
09E1:F1 09         483           dw    buffer        ; pointer to buffer
09E3:00 02         484 reqAmt    dw    512           ; amount to read
09E5:        0002  485 retAmt    ds    2             ; amount actually read
09E7:              486 *
09E7:        09E7  487 CloseParms equ  *
09E7:01            488           db    1             ; number of parms
09E8:        0001  489 cRefNum   ds    1             ; refnum from Open
09E9:              490 *
09E9:        09E9  491 SetMParms equ   *
09E9:02            492           db    2             ; number of parms
09EA:        0001  493 sRefNum   ds    1             ; refnum from Open
09EB:        0003  494 Mark      ds    3             ; file position
09EE:              495 *
09EE:        09EE  496 GetPParms equ   *
09EE:01            497           db    1             ; number of parms
09EF:F1 0B         498           dw    nameBuffer    ; pointer to buffer
09F1:              499 *
09F1:        0200  500 buffer    ds    512           ; enough for whole block
0BF1:              501 *
0BF1:        0040  502 nameBuffer ds   64            ; space for directory name

01 SYMBOL TABLE    SORTED BY SYMBOL                    27-AUG-88  16:20 PAGE 11
 
 09F1 BUFFER         095B CHOPLOOP       0956 CHOPNAME         CC CLOSECMD      
 09E7 CLOSEPARMS     FDED COUT           09E8 CREFNUM        FD8E CROUT         
 09D2 DEPTH          0955 DESTPTR        09A5 DIRDONE          80 DIRNAME       
 084D DONE           09D8 ENTPERBLK        82 ENTPTR         09D7 ENTRYLEN      
 081E EXIT           0953 EXTCNT         0920 EXTENDNAME     0933 EXTLOOP       
 BEF5 GETBUFR        0968 GETNEXT          C7 GETPCMD        09EE GETPPARMS     
 09DC IOBUF          0845 ITSADIR        0831 LOOP           09EB MARK          
 BF00 MLI            0BF1 NAMEBUFFER     0848 NEXTENTRY        24 OENTBLK       
   25 OENTDIR          23 OENTLEN          C8 OPENCMD        0854 OPENDIR       
 0899 OPENDONE       09DA OPENNAME       09D9 OPENPARMS      09DE OREFNUM       
   00 OTYPE          09A7 PRINTENTRY     09D1 PRNTCNT        09C3 PRNTLOOP      
   CA READCMD        0829 READDIR1       081F READDIR        098A READNEXT      
 09DF READPARMS      08B0 RECURSDIR     ?09E3 REQAMT        ?09E5 RETAMT        
 09E0 RREFNUM          CE SETMCMD        09E9 SETMPARMS      0972 SKIP1         
 09B5 SPCDEC         09B0 SPCLOOP        0954 SRCPTR         09EA SREFNUM       
?0800 START          09D5 THISBENTRY     09D6 THISBLOCK      09D3 THISENTRY     
 08A1 VISITDIR       089A VISITFILE     
** SUCCESSFUL ASSEMBLY := NO ERRORS
** ASSEMBLER CREATED ON 15-JAN-84 21:28 
** TOTAL LINES ASSEMBLED   502 
** FREE SPACE PAGE COUNT   81 


Further Reference
o    ProDOS 8 Technical Reference Manual

